<!DOCTYPE html>
<html>
  <head>
    <title>
      mediaelementaudiosourcenode-gc.html
    </title>
    <script src="../../resources/js-test.js"></script>
    <script src="../resources/audit-util.js"></script>
  </head>
  <body>
    <div id="description"></div>
    <div id="console"></div>
    <script id="layout-test-code">
      description('Tests garbage collection of MediaElementAudioSourceNode.');

      function runTest() {
        if (window.testRunner) {
          testRunner.dumpAsText();
        }

        audioElement = document.createElement('audio');
        context = new AudioContext();
        source = context.createMediaElementSource(audioElement);
        audioElement = null;
        context = null;
        source = null;
        gc();

        testPassed('MediaElementAudioSourceNode survived garbage collection.');

        finishJSTest();
      }

      runTest();
    </script>
  </body>
</html>
